package mornd.autowired2;

/**
 * @author: mornd
 * @dateTime: 2023/5/12 - 21:05
 */
public class AssignableTest {

    public static void main(String[] args) {
        System.out.println(Object.class.isAssignableFrom(A.class)); // true
        System.out.println(A.class.isAssignableFrom(A.class)); // true
        System.out.println(A.class.isAssignableFrom(B.class)); // true
        System.out.println(B.class.isAssignableFrom(A.class)); // false
        System.out.println(B.class.isAssignableFrom(C.class)); // true
        System.out.println(A.class.isAssignableFrom(C.class)); // true
    }


    interface A { }

    class B implements A { }

    class C extends B { }

}

